package com.lhy.skywalking.demo.controller;

import com.alibaba.fastjson.JSON;
import com.lhy.skywalking.demo.entity.AlarmMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/alarm")
@Slf4j
public class AlarmController {

    @PostMapping("/notify")
    public void alarmNotify(@RequestBody List<AlarmMessage> messages) {
        log.info("[告警通知] 告警消息：{}", JSON.toJSONString(messages));
    }
}
